---
layout: m1x_soap
title: Address Update
---

				    <h2><a name="customer_address.update-Module%3AMageCustomer"></a>Module: Mage_Customer</h2>


<h3><a name="customer_address.update-Resource%3Acustomeraddress"></a>Resource: customer_address</h3>


<h4><a name="customer_address.update-Method%3A"></a>Method:</h4>

<ul>
	<li>customer_address.update (SOAP V1)</li>
	<li>customerAddressUpdate (SOAP V2)</li>
</ul>


<p>Update address data of the required customer</p>

<p><b>Arguments:</b></p>

<table><tbody>
<tr>
<th> Type </th>
<th> Name </th>
<th> Description </th>
</tr>
<tr>
<td> string </td>
<td> sessionId </td>
<td> Session ID </td>
</tr>
<tr>
<td> int </td>
<td> addressId </td>
<td> Address ID </td>
</tr>
<tr>
<td> array </td>
<td> addressdata </td>
<td> Array of customerAddressEntityCreate </td>
</tr>
</tbody></table>


<p><b>Returns</b>:</p>

<table><tbody>
<tr>
<th> Type </th>
<th> Description </th>
</tr>
<tr>
<td> boolean </td>
<td> True if the customer address is updated </td>
</tr>
</tbody></table>


<p>The <b>customerAddressEntityCreate</b> content is as follows:</p>

<table><tbody>
<tr>
<th> Type </th>
<th> Name </th>
<th> Description </th>
</tr>
<tr>
<td> string </td>
<td> city <br class="atl-forced-newline" /> </td>
<td> Name of the city </td>
</tr>
<tr>
<td> string <br class="atl-forced-newline" /> </td>
<td> company <br class="atl-forced-newline" /> </td>
<td> Name of the company </td>
</tr>
<tr>
<td> string <br class="atl-forced-newline" /> </td>
<td> country_id <br class="atl-forced-newline" /> </td>
<td> Country ID </td>
</tr>
<tr>
<td> string <br class="atl-forced-newline" /> </td>
<td> fax <br class="atl-forced-newline" /> </td>
<td> Fax </td>
</tr>
<tr>
<td> string <br class="atl-forced-newline" /> </td>
<td> firstname <br class="atl-forced-newline" /> </td>
<td> Customer first name </td>
</tr>
<tr>
<td> string <br class="atl-forced-newline" /> </td>
<td> lastname <br class="atl-forced-newline" /> </td>
<td> Customer last name </td>
</tr>
<tr>
<td> string <br class="atl-forced-newline" /> </td>
<td> middlename <br class="atl-forced-newline" /> </td>
<td> Customer middle name </td>
</tr>
<tr>
<td> string <br class="atl-forced-newline" /> </td>
<td> postcode <br class="atl-forced-newline" /> </td>
<td> Postcode </td>
</tr>
<tr>
<td> string <br class="atl-forced-newline" /> </td>
<td> prefix <br class="atl-forced-newline" /> </td>
<td> Customer prefix </td>
</tr>
<tr>
<td> int </td>
<td> region_id <br class="atl-forced-newline" /> </td>
<td> ID of the region </td>
</tr>
<tr>
<td> string <br class="atl-forced-newline" /> </td>
<td> region <br class="atl-forced-newline" /> </td>
<td> Name of the region </td>
</tr>
<tr>
<td> ArrayOfString </td>
<td> street <br class="atl-forced-newline" /> </td>
<td> Array of streets </td>
</tr>
<tr>
<td> string <br class="atl-forced-newline" /> </td>
<td> suffix <br class="atl-forced-newline" /> </td>
<td> Customer suffix </td>
</tr>
<tr>
<td> string <br class="atl-forced-newline" /> </td>
<td> telephone <br class="atl-forced-newline" /> </td>
<td> Telephone number </td>
</tr>
<tr>
<td> boolean </td>
<td> is_default_billing <br class="atl-forced-newline" /> </td>
<td> True if the address is the default one for billing </td>
</tr>
<tr>
<td> boolean </td>
<td> is_default_shipping <br class="atl-forced-newline" /> </td>
<td> True if the address is the default one for shipping </td>
</tr>
</tbody></table>


<h4><a name="customer_address.update-Examples"></a>Examples</h4>

<h5><a name="customer_address.update-RequestExampleSOAPV1"></a>Request Example SOAP V1</h5>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<div>
		<pre class="theme: Default; brush: php; gutter: false">$client = new SoapClient('http://magentohost/api/soap/?wsdl');

// If somestuff requires API authentication,
// then get a session token
$session = $client-&gt;login('apiUser', 'apiKey');

$result = $client-&gt;call(
$session,
'customer_address.update',
array('addressId' =&gt; 8, 'addressdata' =&gt; array('firstname' =&gt; 'John', 'lastname' =&gt; 'Doe', 'street' =&gt; array('Street line 1', 'Streer line 2'), 'city' =&gt; 'Weaverville', 'country_id' =&gt; 'US', 'region' =&gt; 'Texas', 'region_id' =&gt; 3, 'postcode' =&gt; '96093', 'telephone' =&gt; '530-623-2513', 'is_default_billing' =&gt; TRUE, 'is_default_shipping' =&gt; FALSE)));
var_dump ($result);</pre>
		</div>
</div></div>

<h5><a name="customer_address.update-RequestExampleSOAPV2"></a>Request Example SOAP V2</h5>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<div>
		<pre class="theme: Default; brush: php; gutter: false">$client = new SoapClient('http://magentohost/api/v2_soap/?wsdl');

// If some stuff requires API authentication,
// then get a session token
$session = $client-&gt;login('apiUser', 'apiKey');
$result = $client-&gt;customerAddressUpdate($session, '8', array('firstname' =&gt; 'John', 'lastname' =&gt; 'Doe', 'street' =&gt; array('Street line 1', 'Streer line 2'), 'city' =&gt; 'Weaverville', 'country_id' =&gt; 'US', 'region' =&gt; 'Texas', 'region_id' =&gt; 3, 'postcode' =&gt; '96093', 'telephone' =&gt; '530-623-2513', 'is_default_billing' =&gt; FALSE, 'is_default_shipping' =&gt; FALSE));

var_dump ($result);</pre>
		</div>
</div></div>



<h5><a name="customer_address.update-RequestExampleSOAPV2%28WSIComplianceMode%29"></a>Request Example SOAP V2 (WS-I Compliance Mode)</h5>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<div>
		<pre class="theme: Default; brush: php; gutter: false">$proxy = new SoapClient('http://magentohost/api/v2_soap/?wsdl'); 

$sessionId = $proxy-&gt;login((object)array('username' =&gt; 'apiUser', 'apiKey' =&gt; 'apiKey')); 
 
$result = $proxy-&gt;customerAddressUpdate((object)array('sessionId' =&gt; $sessionId-&gt;result, 'addressId' =&gt; '8', 'addressData' =&gt; ((object)array(
'firstname' =&gt; 'John', 
'lastname' =&gt; 'Doe', 
'street' =&gt; array('Street line 1', 'Streer line 2'), 
'city' =&gt; 'Weaverville', 
'country_id' =&gt; 'US', 
'region' =&gt; 'Texas', 
'region_id' =&gt; 3, 
'postcode' =&gt; '96093', 
'telephone' =&gt; '530-623-2513', 
'is_default_billing' =&gt; TRUE, 
'is_default_shipping' =&gt; TRUE
))));   
var_dump($result-&gt;result);</pre>
		</div>
</div></div>


